﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO.Compression;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LinkGame
{
    internal static class Utils
    {
        public static IEnumerable<string> LoadIconSet(ImageList imageList, string iconSet)
        {
            var list = new List<string>();
            imageList.Images.Clear();
            using var zipFile = ZipFile.OpenRead(iconSet);
            foreach (var entry in zipFile.Entries)
            {
                var key = Path.GetFileNameWithoutExtension(entry.Name);
                var bmp = new Bitmap(entry.Open());
                imageList.Images.Add(key, bmp);
                list.Add(key);
            }

            return list;
        }
    }
}
